<template>
	<view @click="jumpgoods">
		<image :src="res.imgurl" mode="" style="width: 100%;height: 1450upx;"></image>
		<view v-for="(res,index) in data" :key="index">
			<!-- notice  公告-->
			<view v-if="res.id == 'notice'">
				<view class="uni-swiper-msg" :style="{background:res.style.background}" style="padding: 12upx;width: 726upx;">
					<view class="uni-swiper-msg-icon" style="width: 70upx;">
						<!-- <image :src="res.params.iconurl"  mode="widthFix" style="width: 70upx;height: 28upx;margin-top: 12upx;padding-right: 10upx;border-right: 2upx solid #e2e2e2;"></image> -->
						<view style="color: #b25415;padding-left: 10upx;">热点</view>
					</view>
					<image src="../../static/notification.png" style="width: 32upx;height: 32upx;margin-top: 10upx;margin-right: 12px;"
					 mode=""></image>
					<swiper vertical="true" autoplay="true" circular="true" interval="3000" class="flex">
						<swiper-item v-for="(item, index3) in res.data" :key="index3">
							<navigator :style="{color:res.style.color}" style="font-size: 24upx;" class="ellipsis-1">{{item.title}}</navigator>
						</swiper-item>
					</swiper>
				</view>
			</view>
		</view>
		<image :src="res2.imgurl" mode="" style="width: 100%;height: 250upx;"></image>
		<view style="width: 100%;height: 70upx;line-height: 70upx;color: #999;font-size: 40upx;text-align: center;">
			立即签约
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				res:[],
				res2:[],
				data:[],
			}
		},
		onLoad:function(e){
			this.goodsid = e.goodsid
			uni.showLoading()
			uni.getStorage({
				key: 'openid',
				success: (res) => {
					this.oid ="&openid=" + res.data
					this.openid =res.data
					this.setAjax()
				},
				fail: () => {
					this.setAjax()
				}
			});
		},
		methods: {
			setAjax(){
				uni.request({
					url: 'http://hszj.hongshantang696.com//app/index.php?i=4&c=entry&m=ewei_shopv2&do=mobile&r=diypage&app=1&id=25',
					success: res => {
						uni.hideLoading()
						
						var obj = res.data
						var arr = []
						for (let i in obj) {
						    arr.push(obj[i]); //值
						}
						console.log(arr)
						
						// 第一张图片和跳转链接
						var obj1 = arr[0].data
						var arr1 = []
						for (let j in obj1) {
						    arr1.push(obj1[j]); //值
						}
						console.log(arr1[0].imgurl);
						
						// 第二张图片和跳转链接
						var obj2 = arr[1].data
						var arr2 = []
						for (let j in obj2) {
						    arr2.push(obj2[j]); //值
						}
						console.log(arr2);
						
						// this.res = res.data.M1557121686576.data.M1557121944010
						// this.res2 = res.data.M1557566512504.data.C1557566512504
					},
					fail: () => {},
					complete: () => {}
				});
				uni.request({
					url: 'http://hszj.hongshantang696.com//app/index.php?i=4&c=entry&m=ewei_shopv2&do=mobile&app=1',
					success: res => {
						uni.hideLoading()
						this.data = res.data
						for (var i in this.data) {
							if (this.data[i].id == 'menu') {
								if (this.data[i].data_temp == undefined) {
									this.data[i].style.width = 375 / this.data[i].style.rownum + 'px'
								}
							}
						}
					},
					fail: () => {},
					complete: () => {}
				});
			},
			jumpgoods(){
				uni.navigateTo({
					url: '../member/acommsion/projcommision/sign'
				})
			}
			
		}
	}
</script>

<style>

</style>

